package com.demo.task.ext

import com.demo.task.MainApplication

private val context = MainApplication.instance


// 将 px 转换为 dp
fun Int.pxToDp(): Int {
    val density: Float = context.resources.displayMetrics.density
    return Math.round(this / density)
}